libxl: idl: allow KeyedUnion members to be empty
authorRob Hoes <rob.hoes@citrix.com>
Fri, 4 Oct 2013 15:58:19 +0000 (16:58 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 31 Oct 2013 18:00:39 +0000 (18:00 +0000)
commitfb3eb6ad946b4daf0c4d3c0404bfa6abde6b3568
tree6bb76f6e595375a5b84ed016b00a7260a1e8385b
parent1e2bf05ec37cf04b0e01585eae524509179f165e
libxl: idl: allow KeyedUnion members to be empty

This is useful when the key enum has an "invalid" option and avoids
the need to declare a dummy struct. Use this for domain_build_info
resulting in the generated API changing like so:
    --- tools/libxl/_libxl_BACKUP_types.h
    +++ tools/libxl/_libxl_types.h
    @@ -377,8 +377,6 @@ typedef struct libxl_domain_build_info {
                 const char * features;
                 libxl_defbool e820_host;
             } pv;
    -        struct {
    -        } invalid;
         } u;
     } libxl_domain_build_info;
     void libxl_domain_build_info_dispose(libxl_domain_build_info *p);

+ a related change to the JSON generation.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/gentest.py
tools/libxl/gentypes.py
tools/libxl/libxl_types.idl